<template>
	<view class="paysuccess">
		<view class="succpage">
		
		<view class="successr">
			<view class="tops" >
				点击外部链接前往支付
			</view>
			<view class="bottoms" @click="gohome">
				返回首页
			</view>
		</view>
	</view>
	
	</view>
	
</template>

<script>
	import $http from '@/common/api/request.js'
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
				
			};
		},
		methods:{
			//完成订单状态更正:
			subedistate(id){
				$http.request({
						url: "/editordestate",
						method:"POST",
						data:{
							outTradeNo:id
						}
					}).then((res) => {
						
					}).catch(() => {
						uni.showToast({
							title: "失败",
							icon: "error",
							mask: true,
							duration: 2000
						})
					})
			},
			//返回首页:
			gohome(){
				uni.navigateTo({
					url:'/pages/index/index'
				})
			},
			//生成详细订单:
			generateDetailedOrder(e){
				$http.request({
						url: "/generateDetailedOrder",
						method:"POST",
						data:{
							alires:JSON.stringify(e)
						}
					}).then((res) => {
						
					}).catch(() => {
						uni.showToast({
							title: "失败.",
							icon: "error",
							mask: true,
							duration: 2000
						})
					})
			}
		},
		onLoad(e) {
			if(e){
				
				this.subedistate(e.order_id);
				this.generateDetailedOrder(e);
			}
		},
		computed:{
			
		}
	}
</script>

<style lang="scss">
	.paysuccess{
		height: 90vh;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.succpage{
	.successr{
		
		.tops{
			text-align: center;
			color: #1a9c34;
			width: 100%;
			}
	.bottoms{
		border: 1rpx solid #06a1ff;
		padding:10rpx 20rpx;
		border-radius: 40rpx;
		text-align: center;
	}
}
	}

</style>
